Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CHE-173] Refactor Auth Middleware #148

Conversation

seantokuzo
Copy link
Contributor

Description

As part of the CHE-167 Back End Error Handling Refactor story, this PR aims to:

  • Refactor the protect auth middleware to make use of custom error classes
  • Refactor the validate-session auth route and authController to use of the protect middleware
  • Add the user field to express's Request interface to eliminate the need to define a CustomRequest type
  • Delete our CustomRequest interface and any usage of it
  • Refactor/simplify repeated usage of protect middleware in router files

Jira Task

JIRA TICKET

Testing Instructions

  • run npm run docker-remove-all
  • run npm run docker-build-check to ensure linting and tests pass
  • run npm run docker-dev
  • log in with test user and make sure app is working as expected

Checklist

All Team Members

  • I added a descriptive title to this PR.
  • I filled out the Description, Jira Task, and Testing Instructions sections above.
  • I added or updated [Jest unit tests]for any changes to components, server-side controllers, etc.
  • I ran npm run docker-build-check in my local environment to check that this PR passes all linting checks and unit tests.
  • I did a quick check to make sure my code changes follow the recommended style guide.

Copy link
Contributor

@brok3turtl3 brok3turtl3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good re-org @seantokuzo! 🎉

@brok3turtl3 brok3turtl3 merged commit 699bff6 into CHE-167/story/BE-Refactor-Error-Handling Jun 17, 2024
1 check passed
@brok3turtl3 brok3turtl3 deleted the CHE-173/subtask/Refactor-Auth-Middleware branch June 17, 2024 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants